﻿using Nest;
using System;

namespace IceDog.ElasticSearchClient.MSTest.Models
{
    [ElasticsearchType(Name = "tweet")]
    public class Tweet
    {
        public Tweet()
        {
            this.Type = "tweet";
        }
        //不知道行的语法咋写,下面俩都不行
        //[Nest.String(Index = FieldIndexOption.NotAnalyzed)] 
        //[ElasticProperty(OmitNorms = true, Index = FieldIndexOption.not_analyzed, IncludeInAll = false, AddSortField = true)]
        public Guid Id { get; set; }
        //之前是 [Nest.String(Analyzer = "standard")] ，现在改了
        //可以稍微参考这里 http://www.cnblogs.com/yswenli/p/6266569.html ，虽然很多对不上了
        [Text( Analyzer ="standard",Boost =1)]
        //如果是使用默认分词，使用上面的，如果用IK分词，使用下面的
        //[Text(Analyzer = "ikmaxword")]
        //[Text(Analyzer = "ik_smart")]
        public string Type { get; set; }
        [Text(Analyzer = "standard")]
        public string User { get; set; }

        public DateTime PostDate { get; set; }
        [Text(Analyzer = "standard")]
        public string Message { get; set; }
        public object Title { get; internal set; }
        public object Content { get; internal set; }
    }
}